package day_240419;

public class TeacherTest {
    public static void main(String[] args) {
/*        Teacher teacher1 = new Teacher();

        System.out.println(teacher1.age);
        // 当前状态的初始值 teacher1.age = 0
        System.out.println(teacher1.name);
        // 当前状态的初始值 teacher1.name = null*/

        // 正常情况下，假如是用户来使用，用户不应该拿到这种数据
        // 那我们又该怎么做让他们访问不到这种初始值

        // 所以应该又我们自己手动写构造器，让对象在实例之初就得有值
        Teacher teacher2 = new Teacher("小红",19);
        System.out.println(teacher2.age);
        System.out.println(teacher2.name);
        System.out.println(teacher2);

        System.out.println("=== === === === ===");

        Teacher teacher3 = new Teacher("小蓝",20);
        System.out.println(teacher3.age);
        System.out.println(teacher3.name);
        System.out.println(teacher3);
    }
}
